package homework;

import org.junit.Test;

import java.io.*;

public class BufferedIOLine02 {
    @Test
    public void testReadLine()throws IOException {

        BufferedReader br = new BufferedReader(new FileReader("in.txt"));
        String line;
        while ((line = br.readLine())!=null) {
            System.out.println(line);
        }
        br.close();
    }

    @Test
    public void testNewLine()throws IOException{
        BufferedWriter bw = new BufferedWriter(new FileWriter("out.txt"));
        bw.write("海");
        bw.newLine();
        bw.write("康");
        bw.newLine();
        bw.write("connect");
        bw.newLine();

        bw.close();
    }
}
